package ar.com.gep.soccer.services.dto;

import java.util.List;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

import ar.com.cdt.framework.business.dto.BaseDTO;

import com.google.gson.annotations.Expose;

public class TeamDTO extends BaseDTO {

	private static final long serialVersionUID = -5175566335979191351L;

	@Expose	
	private String name;

	private SkillDTO skill;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public SkillDTO getSkill() {
		return skill;
	}

	public void setSkill(SkillDTO skill) {
		this.skill = skill;
	}

	public List<Integer> getListSkills() {
		return getSkill().getList();
	}

	@Override
	public int hashCode() {
		return new HashCodeBuilder().append(getId()).append(getName()).toHashCode();
	}

	@Override
	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}
		if (obj == this) {
			return true;
		}
		if (obj.getClass() != getClass()) {
			return false;
		}
		TeamDTO teamDTO = (TeamDTO) obj;
		return new EqualsBuilder().append(getId(), teamDTO.getId()).append(getName(), teamDTO.getName()).isEquals();
	}

}
